[SUBROUTINE]
version = 1.14
icon = taper-odl.png
name = _("Taper ODL")
type = taper_odl
help = _("<b>Machine a taper by length, small and large diameter</b>&#10;Cutter orientation should be 1, 2, 9 or None")
order = act hx b_x e_x hz b_z e_z hp pa hf fin

[PARAM_ACT]
name = _("Active")
icon = enable.png
type = bool
value = 1

[PARAM_HX]
name = _("X axis")
type = sub-header

[PARAM_B_X]
name = _("Large diameter")
type = float
icon = taper-x-ld.png
value = 1.0
metric_value = 25.0
minimum_value = 0.0
not_allowed = 0
header = hx

[PARAM_E_X]
name = _("Small diameter")
type = float
icon = taper-x-sd.png
value = 0.9
metric_value = 22.0
minimum_value = 0.0
header = hx

[PARAM_HZ]
name = _("Z axis")
type = sub-header

[PARAM_B_Z]
name = _("Small diameter")
type = float
icon = taper-z-sd.png
value = 0.0
metric_value = 0.0
header = hz

[PARAM_E_Z]
name = _("Large diameter")
type = float
icon = taper-z-ld.png
value = -1.0
metric_value = -25.0
header = hz

[PARAM_HP]
name = _("Params")
type = sub-header

[PARAM_PA]
name = _("Path")
type = combo
options = _("Follow drive line=0:Angular=1")
value = 0
header = hp
;icon =
;tool_tip =

[PARAM_HF]
name = _("Finishing")
type = sub-header

[PARAM_FIN]
name = _("Number of passes")
icon = finish.png
type = int
value = 1
minimum_value = 0
tool_tip = _("Or spring passes")
header = hf

[VALIDATION]
content =
	if #param_act == 1 :
		if self.check_hash('#param_b_z', 0) == self.check_hash('#param_e_z', 0) :
			self.msg_inv(_('Begin Z must not be equal to End Z'), 1)
			VALIDATED = False
			
		if self.check_hash('#param_b_x', 0) == self.check_hash('#param_e_x', 0) :
			self.msg_inv(_('Begin X must not be equal to End X'), 2)
			VALIDATED = False
	
		if self.check_hash('#param_b_z', 0) > self.check_hash('#param_e_z', 0) and \
				TOOL_TABLE.get_tool_orient() not in [0, 2, 9] :
			self.msg_inv(_('Cutter orientation should be 2, 9 or 0'), 4)
		elif self.check_hash('#param_b_z', 0) < self.check_hash('#param_e_z', 0) and \
				TOOL_TABLE.get_tool_orient() not in [0, 1, 9] :
			self.msg_inv(_('Cutter orientation should be 1, 9 or 0'), 4)

[CALL]
content =
	(begin #sub_name)
	(author : Fernand Veilleux)
	
	o<#self_id_act> if [#param_act]
		o<line> CALL [#param_e_z] [-#param_b_x / 2] [#param_b_z] [-#param_e_x / 2]
		
		o<taper> CALL [#param_b_x] [#param_e_x] [#param_b_z] [#<_line_phi>] [#param_fin] [#param_pa]
	o<#self_id_act> endif
	
	(end #sub_name)
